{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hi\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "11"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "let x: number = 5;\n",
    "const y: number = 6;\n",
    "var z: string = \"hi\";\n",
    "console.log(z);\n",
    "x + y;"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "11"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "function add(num1: number, num2: number): number {\n",
    "    return num1 + num2\n",
    "}\n",
    "add(x, y);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "11"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "const arrowAdd = (num1: number, num2: number) => num1 + num2;\n",
    "arrowAdd(x, y);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"Hello, I'm John\""
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "class User {\n",
    "  constructor(private name: string) {\n",
    "    this.name = name;\n",
    "  }\n",
    "  sayHello(): string {\n",
    "    return \"Hello, I'm \" + this.name;\n",
    "  }\n",
    "}\n",
    "let John: User;\n",
    "John = new User(\"John\");\n",
    "John.sayHello();"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Typescript 3.5",
   "language": "typescript",
   "name": "typescript"
  },
  "language_info": {
   "file_extension": ".ts",
   "mimetype": "application/x-typescript",
   "name": "typescript",
   "version": "3.5.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
